﻿using ConfigServices;
using LogServices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MailServices
{
    public class MailService : IMailServices
    {
        private readonly ILogProvider log;
        //private readonly IConfigService config;
        private readonly IConfigReader config;

        // public MailService(ILogProvider log, IConfigService config)
        public MailService(ILogProvider log, IConfigReader config)
        {
            this.log = log;
            this.config = config;
        }

        public void Send(string title, string to, string content)
        {
            this.log.LogInfo("开始发送邮件");
            string SmtpServer = this.config.GetValue("SmtpServer");
            Console.WriteLine($"邮件配置！{SmtpServer}"); ;
            Console.WriteLine($"发送邮件！{title} {to} {content}"); ;
            this.log.LogInfo("发送邮件完毕");
        }
    }
}
